
import { reqIndexData } from '../api/index'
Page({
  data: {
    bannerList: [],//轮播图数据
    categoryList: [], //商品导航数据
    activeList: [],//活动渲染区域
    hotList: [],//人气推荐
    guessList: [],//猜你喜欢
    isLoading: true
  },
  // 获取首页并发的全部数据
  async getIndexData() {
    const res = await reqIndexData()
    this.setData({
      bannerList: res[0].data,
      categoryList: res[1].data,
      activeList: res[2].data,
      hotList: res[3].data,
      guessList: res[4].data,
      isLoading: false
    })
  },
  onShow() {
    this.getIndexData()
  },
});
